//
//  XYJFSTableViewCell.m
//  徙游记-01
//
//  Created by hcios on 2017/7/14.
//  Copyright © 2017年 鹿林. All rights reserved.
//

#import "XYJFSTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation XYJFSTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupSubViews];
    }
    return self;
}


-(void)setupSubViews{
    CGFloat maring = 38 / 3;
    _titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 50, 50)];
    _titleImage.layer.cornerRadius = 20;
    _titleImage.layer.masksToBounds = YES;
    [self addSubview:_titleImage];
    
    _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_titleImage.frame) + 5, maring, SCREEN_WIDTH - 60, 20)];
    [_titleLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:13]];
    _titleLab.textAlignment = NSTextAlignmentLeft;
    _titleLab.textColor = [UIColor blackColor];
    [self addSubview:_titleLab];
    
    _contextLab = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_titleImage.frame) + 5, CGRectGetMaxY(_titleLab.frame) + maring, SCREEN_WIDTH - 60, 20)];
    [_contextLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:13]];
    _contextLab.textAlignment = NSTextAlignmentLeft;
    _contextLab.textColor = [UIColor blackColor];
    [self addSubview:_contextLab];
}


-(void)setModel:(XYJFSModel *)model{
    _model = model;
    [_titleImage sd_setImageWithURL:[NSURL URLWithString:model.fs_image] placeholderImage:nil];
    
    _titleLab.text = model.fs_name;
    
    _contextLab.text = model.fs_latest_publish_trip_name;
}

@end
